package com.weitu.risk.service.impl;

import com.weitu.risk.entity.Region;
import com.weitu.risk.mapper.RegionMapper;
import com.weitu.risk.service.RegionService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RegionServiceImpl implements RegionService {
    @Autowired
    private RegionMapper regionMapper;

    @Override
    public List<Region> queryListByParam(Map<String, Object> map) {
        return this.regionMapper.queryListByParam(map);
    }

    @Override
    public int queryListCountByParam(Map<String, Object> map) {
        return this.regionMapper.queryListCountByParam(map);
    }

    public Region queryRegionById(String id){
        return this.regionMapper.queryRegionById(id);
    }
    @Override
    public boolean addRegion(Map<String, Object> map) {
        int result = this.regionMapper.insertRegion(map);
        if(result<1){
            return false;
        }
        return true;
}

    @Override
    public boolean editRegion(Map<String, Object> map) {
        int result = this.regionMapper.updateRegion(map);
        if(result<1){
            return false;
        }
        return true;
    }

    @Override
    public boolean deleteRegionById(String id) {
        int result = this.regionMapper.deleteRegionById(id);
        if(result<1){
            return false;
        }
        return true;
    }
    /**
     *查询下拉列表数据
     * @return
     */
    public List<Map<String,Object>> queryComboboxList(Map<String,Object> map){
        return this.regionMapper.queryComboboxList(map);
    }
}